/*
 * @(#)cn.design.pattern.composite 2020/4/18/0018
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.composite;

import java.util.LinkedList;
import java.util.List;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/18/0018
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class College extends OrganizationComponent {
	private List<OrganizationComponent> departments = new LinkedList<>();

	public College(String name, String des) {
		super(name, des);
	}

	@Override
	protected void add(OrganizationComponent component) {
		departments.add(component);
	}

	@Override
	protected void remove(OrganizationComponent component) {
		departments.remove(component);
	}

	@Override
	protected void print() {
		System.out.println("------------------" + getName() + "-----------------");
		for (OrganizationComponent component : departments) {
			component.print();
		}
	}
}
